package com.fengmi.miaosha.controller;


import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.fengmi.miaosha.service.IMsOrderService;
import com.fengmi.vo.ResultVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zhuxm
 * @since 2022-03-17
 */
@RestController
@RequestMapping("/miaosha/order")
public class MsOrderController {

    @Autowired
    private IMsOrderService orderService;

    /**
     * 秒杀下单
     * @param goodsId
     * @param time
     * @return
     */
    @RequestMapping("save")
    public ResultVO save(String goodsId,String time){
        return  orderService.msOrder(goodsId,time);
    }


    @RequestMapping("acquireBizId")
    public ResultVO acquireBizId(){
        return new ResultVO(true,"",IdWorker.getIdStr());
    }

}
